<template>
  <template v-for="(item, index) of FromArr">
    <FromList :title="index === 0 ? title : ''" :FromArr="item" @blur="blur" :froKey="item.key" />
  </template>
</template>
<script setup>
import FromList from './FromList.vue'

const props = defineProps({
  title: {
    type: String,
    default: ''
  },
  FromArr: {
    type: Array,
    default: function () {
      return []
    }
  },
  labelWidth: {
    type: String,
    default: ''
  },
  froKey: {
    type: String,
    default: ''
  }
})

//此处必须用toRefs，否则将失去响应式
const { FromArr, title, labelWidth, froKey } = toRefs(props);

const blur = function (data, FromArr, froKey) {
  emit('blur', data, FromArr, froKey)
}
</script>